﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsumeAndProduceFactory
{
    public class TestFacade
    {
        public  int productnum = 0;

        public  void myProduce(Object sender,FactoryEventArgs args)
        {
            productnum++;
            List<Object> list = new List<Object>();
            list.Add((Object)productnum);
            args.Products = list;
            Console.WriteLine("{0} has produced the {1}th product.", sender.ToString(), productnum);
        }

        public  void myConsume(Object sender, FactoryEventArgs args)
        {
            Random ro = new Random();
            List<Object> list = args.Products;
            foreach (Object number in list)
                Console.WriteLine("The {0}th product is consumed", (int)number);
        }
    }
}
